package edu.psu.collegerecommendationhelper.algorithm;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import edu.psu.collegerecommendationhelper.model.DemographicInfo;
import edu.psu.collegerecommendationhelper.model.EducationInfo;
import edu.psu.collegerecommendationhelper.model.PreferenceInfo;


import weka.core.Instance;
import weka.core.Instances;

public class RecommendationResultsTest {
	UserToClassifierTranslator xlate = new UserToClassifierTranslator();
	ClassifierData data = null;
	
	@Before
	public void setUp() throws Exception {

		DemographicInfo demogrInfo = new DemographicInfo();
		EducationInfo edu = new EducationInfo();
		PreferenceInfo pref = new PreferenceInfo();
		
		demogrInfo.setState("NJ");
		demogrInfo.setRace("white");
		
		edu.setGPA((float) 3.0);
		edu.setCreadSAT((short) 600);
		
		pref.setPubpri("public");
		pref.setSize("1000");
		pref.setLocation("new jersey");

		data = xlate.translateData(demogrInfo, edu, pref);    	
    	
	}

	@Test
	public void testTestUserAgainstRegressionmodel() {
		Instances test = xlate.createTestInstances(data);
		
		assertNotNull("failed to create instances", test);
		
		Instance theInstance = test.firstInstance();
		
		int i=0;
		assertEquals("answer false", 1, theInstance.index(i));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));		
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));
		assertEquals("answer false", 0, theInstance.index(i++));

	}

}
